/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package py.com.domain;

import java.io.Serializable;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author markos
 */
@Entity
@Table(name = "paises")
@NamedQueries({@NamedQuery(name = "Paises.findAll", query = "SELECT p FROM Paises p"), @NamedQuery(name = "Paises.findByPaPais", query = "SELECT p FROM Paises p WHERE p.paPais = :paPais"), @NamedQuery(name = "Paises.findByPaDescripcion", query = "SELECT p FROM Paises p WHERE p.paDescripcion = :paDescripcion"), @NamedQuery(name = "Paises.findByPaGentilicio", query = "SELECT p FROM Paises p WHERE p.paGentilicio = :paGentilicio")})
public class Paises implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="paisGen")
    @SequenceGenerator(name="paisGen", sequenceName="paises_pa_pais_seq")
    @Basic(optional = false)
    @Column(name = "pa_pais")
    private Integer paPais;
    @Column(name = "pa_descripcion")
    private String paDescripcion;
    @Column(name = "pa_gentilicio")
    private String paGentilicio;
    @OneToMany(mappedBy = "rgPais", fetch = FetchType.LAZY)
    private Set<Region> regionSet;
    @OneToMany(mappedBy = "dnNacionalidad", fetch = FetchType.LAZY)
    private Set<Personas> personasSet;
    @OneToMany(mappedBy = "dnPaisOrigen", fetch = FetchType.LAZY)
    private Set<Personas> personasCollection1;

    public Paises() {
    }

    public Paises(Integer paPais) {
        this.paPais = paPais;
    }

    public Integer getPaPais() {
        return paPais;
    }

    public void setPaPais(Integer paPais) {
        this.paPais = paPais;
    }

    public String getPaDescripcion() {
        return paDescripcion;
    }

    public void setPaDescripcion(String paDescripcion) {
        this.paDescripcion = paDescripcion;
    }

    public String getPaGentilicio() {
        return paGentilicio;
    }

    public void setPaGentilicio(String paGentilicio) {
        this.paGentilicio = paGentilicio;
    }

    public Set<Region> getRegionSet() {
        return regionSet;
    }

    public void setRegionSet(Set<Region> regionSet) {
        this.regionSet = regionSet;
    }

    public Set<Personas> getPersonasSet() {
        return personasSet;
    }

    public void setPersonasSet(Set<Personas> personasSet) {
        this.personasSet = personasSet;
    }

    public Set<Personas> getPersonasCollection1() {
        return personasCollection1;
    }

    public void setPersonasCollection1(Set<Personas> personasCollection1) {
        this.personasCollection1 = personasCollection1;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (paPais != null ? paPais.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Paises)) {
            return false;
        }
        Paises other = (Paises) object;
        if ((this.paPais == null && other.paPais != null) || (this.paPais != null && !this.paPais.equals(other.paPais))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.domain.Paises[paPais=" + paPais + "]";
    }

}
